package com.example.config;

import com.example.Interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@Configuration
public class webmvcconfig extends WebMvcConfigurationSupport {
    final
    LoginInterceptor interceptor;

    public webmvcconfig(LoginInterceptor interceptor) {
        this.interceptor = interceptor;
    }

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor)
                .addPathPatterns("/user/**")
                .excludePathPatterns("/user/login");
    }
}
